package cn.mulanbay.api.system.service;

import cn.mulanbay.api.system.bean.RemoteOperationLog;
import cn.mulanbay.api.system.bean.RemoteSystemLog;
import cn.mulanbay.api.system.config.FeignRequestInterceptor;
import cn.mulanbay.api.system.factory.RemoteLogFallbackFactory;
import cn.mulanbay.common.config.ServiceNameConstants;
import cn.mulanbay.common.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 日志服务
 *
 * @author fenghong
 */
@FeignClient(contextId = "remoteLogService",
        value = ServiceNameConstants.LOG_SERVICE,
        fallbackFactory = RemoteLogFallbackFactory.class,
        configuration={FeignRequestInterceptor.class})
public interface RemoteLogService {

    /**
     * 增加系统日志
     * @param log
     * @return
     */
    @PostMapping(value = "/systemLog/create")
    public R<Long> addSystemLog(@RequestBody RemoteSystemLog log);

    /**
     * 增加操针日志
     * @param log
     * @return
     */
    @PostMapping("/operationLog/create")
    public R<Long> addOperationLog(@RequestBody RemoteOperationLog log);

}
